-
Notifications
You must be signed in to change notification settings - Fork 0
Interface overhaul #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The goal of this PR is to increase the expressivity of the benchmarks interface, to allow for easy implmentations of stochastic and dynamic benchmark problems.
New abstract types
For this, we define two new sub abstract types of
AbstractBenchmark:AbstractDynamicBenchmark{exogenous} <: AbstractStochasticBenchmark{exogenous} <: AbstractBenchmarkRemarks:
exogenousparameter, a boolean indicating if the benchmark is exogenous or not (i.e. if one can generate scenarios and anticipative decisions).New interface methods
For
AbstractBenchmarkImplementing the full
generate_datasetmethod can in practice be a bit tedious and verbose for no reason. While keeping the option to implement it for some applications where it makes sense, we propose an alternative where the user only needs to implement agenerate_samplemethod that outputs a singleDataSampleinstead of a full dataset:For
AbstractStochasticBenchmark{true}We need two new methods, one for generating scenarios, and one for computing anticipative decisions:
For
AbstractDynamicBenchmarkFor dynamic problems, we additionally need to instantiate environments from instances. For this, we define the
generate_environmentandgenerate_environmentsmethods. Similarly togenerate_sampleandgenerate_datasets, one may only need to implement the first one, that takes as inpout an instance and outputs an environment.AbstractEnvironmentThis environment type can be defined as a subtype of
AbstractEnvironment, along with its associated methods:get_seedis_terminatedstep!observereset!Additionally, we may want to apply RL algorithms to non-dynamic benchmarks, by considering them as dynamic problems with time horizon of length 1. We therefore propose a
StaticEnv <: AbstractEnvwrapper around static instances for this (#35)PolicyWe also have a new
generate_policiesmethodwhich outputs a tuple of
Policy, i.e. policies to benchmark against.In particular you can use
run_policy!to run the policy on a given set of environments for a set number of episodes each.New Benchmark problems
We plan to additionally implement the Dynamic VRP as well as the dynamic Inventory routing.
Points I'm unsure about
TODO: